/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.bo;

import org.ipti.br.tag.dao.PersonageFacade;
import org.ipti.br.tag.entity.Organization;
import org.ipti.br.tag.entity.Personage;
import java.io.Serializable;
import java.util.List;
import javax.inject.Inject;
import javax.ejb.Stateless;

/**
 *
 * @author root
 */
@Stateless
public class PersonageBO implements Serializable {

    @Inject
    private PersonageFacade personageDAO;

    public PersonageFacade getPersonageDAO() {
        return personageDAO;
    }

    public void create(Personage personage) {
        getPersonageDAO().create(personage);
    }

    public void edit(Personage personage) {
        getPersonageDAO().edit(personage);
    }

    public void remove(Personage personage) {
        getPersonageDAO().remove(personage);
    }

    public Personage find(Object id) {
        return getPersonageDAO().find(id);
    }

    public List<Personage> findAll() {
        return getPersonageDAO().findAll();
    }

    public void editForSynchronization(Personage personage) {
        getPersonageDAO().editForSynchronization(personage);
    }

    public Personage getPersonage(Long organizationID, Long personageFatherID) {
        return getPersonageDAO().getPersonagePerOrganizationPersonageFather(organizationID, personageFatherID);
    }

    public List<Personage> getPersonageChildren(Long personageFatherID) {
        return getPersonageDAO().getPersonageChildren(personageFatherID);
    }
    
    public List<Long> getPersonageChildrenIDs(Long personageFatherID) {
        return getPersonageDAO().getPersonageChildrenIDs(personageFatherID);
    }
    
    public List<Personage> findAllOrder() {
        return getPersonageDAO().findAllOrder();
    }
    
    public List<Personage> getAllocatedPersonages(Organization organization) {
        return getPersonageDAO().getAllocatedPersonage(organization);
    }
    
    public Personage getPersonageByName(String personageName) {
        return getPersonageDAO().getPersonageByName(personageName);
    }
}
